<% table = @table unless @table.nil? %>
<% table ||= nil %>
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title><%= @table.nil? ? "All Tables" : @table.title %></title>
    <script type="text/javascript"
            src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("jquery", "1", {uncompressed:true})
    </script>
    <%= javascript_script_tag "/javascripts/jquery.tablesorter.js" %>
    <%= javascript_script_tag "/javascripts/jquery.tablesorter.pager.js" %>
    <%= javascript_script_tag "/javascripts/jquery.tablesorter.multipagefilter.js" %>
    <%= javascript_script_tag "/javascripts/application.js" %>
    <%= stylesheet_link_tag "/stylesheets/stylesheet.css", :media=>"screen" %>
    
    <script>
      <% if !table.nil? %>
        var sortPlease = <%= @table.sortable? %>;
        var sortOrder = <%= @table.sort_array.inspect || "null"%>;
        var perPage = <%= @table.per_page %>;
      <% else %>
        var sortPlease = false;
      <% end %>
    </script>
    
  </head>
  <body>
    <div id="table_fu">
      <%= yield %>
    </div>
  </body>
</html>
